package com.ruoyi.houses.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.houses.mapper.AtbPropertyHouseMapper;
import com.ruoyi.houses.domain.AtbPropertyHouse;
import com.ruoyi.houses.service.IAtbPropertyHouseService;

/**
 * 新房Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-09-16
 */
@Service
public class AtbPropertyHouseServiceImpl implements IAtbPropertyHouseService 
{
    @Autowired
    private AtbPropertyHouseMapper atbPropertyHouseMapper;

    /**
     * 查询新房
     * 
     * @param id 新房主键
     * @return 新房
     */
    @Override
    public AtbPropertyHouse selectAtbPropertyHouseById(Long id)
    {
        return atbPropertyHouseMapper.selectAtbPropertyHouseById(id);
    }

    /**
     * 查询新房列表
     * 
     * @param atbPropertyHouse 新房
     * @return 新房
     */
    @Override
    public List<AtbPropertyHouse> selectAtbPropertyHouseList(AtbPropertyHouse atbPropertyHouse)
    {
        return atbPropertyHouseMapper.selectAtbPropertyHouseList(atbPropertyHouse);
    }

    /**
     * 新增新房
     * 
     * @param atbPropertyHouse 新房
     * @return 结果
     */
    @Override
    public int insertAtbPropertyHouse(AtbPropertyHouse atbPropertyHouse)
    {
        atbPropertyHouse.setCreateTime(DateUtils.getNowDate());
        return atbPropertyHouseMapper.insertAtbPropertyHouse(atbPropertyHouse);
    }

    /**
     * 修改新房
     * 
     * @param atbPropertyHouse 新房
     * @return 结果
     */
    @Override
    public int updateAtbPropertyHouse(AtbPropertyHouse atbPropertyHouse)
    {
        return atbPropertyHouseMapper.updateAtbPropertyHouse(atbPropertyHouse);
    }

    /**
     * 批量删除新房
     * 
     * @param ids 需要删除的新房主键
     * @return 结果
     */
    @Override
    public int deleteAtbPropertyHouseByIds(Long[] ids)
    {
        return atbPropertyHouseMapper.deleteAtbPropertyHouseByIds(ids);
    }

    /**
     * 删除新房信息
     * 
     * @param id 新房主键
     * @return 结果
     */
    @Override
    public int deleteAtbPropertyHouseById(Long id)
    {
        return atbPropertyHouseMapper.deleteAtbPropertyHouseById(id);
    }
}
